package com.xhui.vimarket.common.utils.vo;

import lombok.Getter;
import lombok.Setter;

/**
 * BaseVo.
 * 
 * @版权：福富软件 版权所有 (c) 2011
 * @author wuyx
 * @version Revision 1.0.0
 * @see:
 * @创建日期：2011-2-16
 * @功能说明：
 */
public class BaseVo implements java.io.Serializable {
    
    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = -4915657763697379900L;
    
    /**
     * id.
     */
    @Setter
    @Getter
    private int               id;
    
    /**
     * name.
     */
    @Setter
    @Getter
    private String            name;
    
    /**
     * key.
     */
    @Setter
    @Getter
    private String            key;
    
    /**
     * type.
     */
    @Setter
    @Getter
    private String            type;
    
    /**
     * page.
     */
    @Setter
    private int               page;
    
    /**
     * pageSize.
     */
    @Setter
    private int               pageSize;
    /**
     * totalSize.
     */
    @Setter
    @Getter
    private int               totalSize;
    
    public int getPage() {
        return page;
    }
    
    /**
     * getPage.
     * 
     * @param defaultValue int
     * @return int
     */
    public int getPage(int defaultValue) {
        return page < 1 ? 1
            : page;
    }
    
    public int getPageSize() {
        return pageSize;
    }
    
    /**
     * getPageSize.
     * 
     * @param defaultValue
     *            int
     * @return int
     */
    public int getPageSize(int defaultValue) {
        return pageSize < 1 ? defaultValue
            : pageSize;
    }
}
